#include  <cstdio>

int main(int argc, char *argv[])
{
	int n;
	scanf("%d",&n);
	for( int a = 4; a <= n ; ++a )
	{
		for( int i = 2; i < n ; ++i )
		{
			for( int j = i; j < n  ; ++j )
			{
				for( int m = j; m < n ; ++m )
				{
					if( a*a*a == i*i*i + j*j*j + m*m*m )
					{
						printf("Cube = %d, Triple = (%d,%d,%d)\n",
								a,i,j,m);
					}
				}
				
			}
			
		}
		
	}
	
}
